package com.ara.common.kernel.address;

import com.contrarywind.interfaces.IPickerViewData;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by XieXin on 2019/4/2.
 * 省市区实体类
 */
public class ProvinceBean implements IPickerViewData {
    private String name;//名字
    private String code;//编码
    private List<CityBean> children;//市

    public ProvinceBean() {
    }

    public ProvinceBean(String name, String code) {
        this.name = name;
        this.code = code;
    }

    public String getName() {
        return name == null ? "" : name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code == null ? "" : code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public List<CityBean> getChildren() {
        return children == null ? new ArrayList<>() : children;
    }

    public void setChildren(List<CityBean> children) {
        this.children = children;
    }

    // 实现 IPickerViewData 接口，
    // 这个用来显示在PickerView上面的字符串，
    // PickerView会通过IPickerViewData获取getPickerViewText方法显示出来。
    @Override
    public String getPickerViewText() {
        return this.name;
    }
}
